package com.neuedu.config;

import com.neuedu.core.NeueduException;
import com.neuedu.vo.ResultJson;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class DefaultException {
    @ExceptionHandler(value = NeueduException.class)
    public ResultJson defaultNeueduExceptionHandler(Exception ex) {
        ex.printStackTrace();
        return ResultJson.error(ex.getMessage());
    }
    @ExceptionHandler
    public ResultJson defaultExceptionHandler(Exception ex) {
        ex.printStackTrace();
        return ResultJson.error("服务器异常,请联系管理员");
    }
}
